/*   1:    */ package com.rinsi.app.azsb.azzl.azsqs.gkjsq.four;
/*   2:    */ 
/*   3:    */ import com.rinsi.core.CoreCache;
/*   4:    */ import com.rinsi.core.service.CoreSimpleService;
/*   5:    */ import com.rinsi.util.ListUtil;
/*   6:    */ import com.rinsi.util.MapUtil;
/*   7:    */ import java.util.HashMap;
/*   8:    */ import java.util.List;
/*   9:    */ import java.util.Map;
/*  10:    */ import org.mybatis.spring.SqlSessionTemplate;
/*  11:    */ import org.springframework.stereotype.Service;
/*  12:    */ 
/*  13:    */ @Service
/*  14:    */ public class GkjsqFourService
/*  15:    */   extends CoreSimpleService
/*  16:    */ {
/*  17:    */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/*  18:    */   {
/*  19: 21 */     Map<String, Object> params = getParams(model);
/*  20:    */     
/*  21: 23 */     Map<String, Object> config = getConfig(model);
/*  22:    */     
/*  23: 25 */     rMap.putAll(getParams(model));
/*  24:    */     
/*  25: 27 */     List<Map<String, Object>> modules = CoreCache.getCacheList(MapUtil.getString(params, "UID"), "modules");
/*  26:    */     
/*  27: 29 */     List<Map<String, Object>> sub_rights = ListUtil.subList(modules, "MODULE_NO_PRE='500002'");
/*  28:    */     
/*  29: 31 */     rMap.put("azsbxx", getSqlSessionTemplate().selectOne("azsb.get", params));
/*  30:    */     
/*  31: 33 */     rMap.put("userxx", CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "user"));
/*  32:    */     
/*  33: 35 */     model.put("sub_rights", ListUtil.listToMap(sub_rights, "MODULE_TYPE"));
/*  34:    */     try
/*  35:    */     {
/*  36: 39 */       List<Map<String, Object>> datas = getSqlSessionTemplate().selectList(namespace(config) + ".list", params);
/*  37:    */       
/*  38: 41 */       rMap.put("datas", datas);
/*  39:    */       
/*  40: 43 */       rMap.put("success", Boolean.valueOf(true));
/*  41:    */     }
/*  42:    */     catch (Exception e)
/*  43:    */     {
/*  44: 47 */       rMap.put("success", Boolean.valueOf(false));
/*  45: 49 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/*  46: 51 */         rMap.put("message", e.getMessage());
/*  47:    */       } else {
/*  48: 55 */         rMap.put("message", "展示数据列表出错！请稍后重试，或联系系统管理员！");
/*  49:    */       }
/*  50: 58 */       rMap.put("ex", e.getMessage());
/*  51:    */       
/*  52: 60 */       e.printStackTrace();
/*  53:    */     }
/*  54:    */   }
/*  55:    */   
/*  56:    */   public Map<String, Object> zwpgSave(Map<String, Object> model)
/*  57:    */   {
/*  58: 68 */     Map<String, Object> rMap = new HashMap();
/*  59:    */     
/*  60: 70 */     Map<String, Object> params = getParams(model);
/*  61:    */     
/*  62: 72 */     Map<String, Object> config = getConfig(model);
/*  63:    */     
/*  64: 74 */     rMap.putAll(getParams(model));
/*  65:    */     
/*  66: 76 */     String[] ZCXXX_IDs = params.get("ZCXXX_IDs").toString().split(",");
/*  67:    */     
/*  68: 78 */     String[] ZWPG_PGJGs = params.get("ZWPG_PGJGs").toString().split(",");
/*  69:    */     try
/*  70:    */     {
/*  71: 82 */       getSqlSessionTemplate().selectList(namespace(config) + ".delete", params);
/*  72:    */     }
/*  73:    */     catch (Exception e)
/*  74:    */     {
/*  75: 86 */       rMap.put("success", Boolean.valueOf(false));
/*  76: 88 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/*  77: 90 */         rMap.put("message", e.getMessage());
/*  78:    */       } else {
/*  79: 94 */         rMap.put("message", "操作错误，请联系系统管理员！");
/*  80:    */       }
/*  81: 97 */       rMap.put("ex", e.getMessage());
/*  82:    */       
/*  83: 99 */       e.printStackTrace();
/*  84:    */     }
/*  85:103 */     for (int i = 0; i < ZWPG_PGJGs.length; i++)
/*  86:    */     {
/*  87:105 */       Map<String, Object> selectParam = new HashMap();
/*  88:    */       
/*  89:107 */       selectParam.put("ZWPG_PGJG", ZWPG_PGJGs[i]);
/*  90:    */       
/*  91:109 */       selectParam.put("ZCXXX_ID", ZCXXX_IDs[i]);
/*  92:    */       
/*  93:111 */       selectParam.put("AZSB_ID", params.get("AZSB_ID"));
/*  94:    */       
/*  95:113 */       selectParam.put("UID", params.get("UID"));
/*  96:    */       
/*  97:115 */       selectParam.put("SQS_TYPE", params.get("SQS_TYPE"));
/*  98:    */       try
/*  99:    */       {
/* 100:119 */         getSqlSessionTemplate().update(namespace(config) + ".update", selectParam);
/* 101:    */         
/* 102:121 */         rMap.put("success", Boolean.valueOf(true));
/* 103:    */       }
/* 104:    */       catch (Exception e)
/* 105:    */       {
/* 106:125 */         rMap.put("success", Boolean.valueOf(false));
/* 107:127 */         if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/* 108:129 */           rMap.put("message", e.getMessage());
/* 109:    */         } else {
/* 110:133 */           rMap.put("message", "展示数据列表出错！请稍后重试，或联系系统管理员！");
/* 111:    */         }
/* 112:136 */         rMap.put("ex", e.getMessage());
/* 113:    */         
/* 114:138 */         e.printStackTrace();
/* 115:    */       }
/* 116:    */     }
/* 117:144 */     return rMap;
/* 118:    */   }
/* 119:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.azsb.azzl.azsqs.gkjsq.four.GkjsqFourService
 * JD-Core Version:    0.7.0.1
 */